<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/memberdetail.css" />
<script type="text/javascript">
$(function() {
	var indexline = ${indexLine};	
	//var a =$("#hidewin");
	var urlPrefix = "${pageContext.request.contextPath}/api/";
	var images = new Array(5);
	var imageLoadCount = 0;
	
	showImages(indexline);
	linkButtonClick();
	
	function linkButtonClick() {		
		$('#btn_show_image_popup').click(function() {			
			showImages(indexline);
		});
	}
	
	function showImages(indexline){		
		if(indexline >= 0){
			var strTemp = ''; 
			var intTemp = 0;
			imageLoadCount = 0;
        	images = new Array(5);
        	var imageInfo1 = {};
        	strTemp = "<s:property value='memberDto.imageContactCertificatesFront'/>";
        	if(strTemp==''){
        		intTemp = null;
        	}else{
        		intTemp = parseInt(strTemp);
        	}
        	imageInfo1.image_id = intTemp;
        	imageInfo1.loaded = false;
        	imageInfo1.image_data = null;
        	imageInfo1.title = "联系人证件正面";
        	images[0] = imageInfo1;
        	
        	var imageInfo2 = {};
        	strTemp = "<s:property value='memberDto.imageContactCertificatesBack'/>";
        	if(strTemp==''){
        		intTemp = null;
        	}else{
        		intTemp = parseInt(strTemp);
        	}
        	imageInfo2.image_id = intTemp;
        	imageInfo2.loaded = false;
        	imageInfo2.image_data = null;
        	imageInfo2.title = "联系人证件背面";
        	images[1] = imageInfo2;

        	var imageInfo3 = {};
        	strTemp = "<s:property value='memberDto.imageLicense'/>";
        	if(strTemp==''){
        		intTemp = null;
        	}else{
        		intTemp = parseInt(strTemp);
        	}
        	imageInfo3.image_id = intTemp;
        	imageInfo3.loaded = false;
        	imageInfo3.image_data = null;
        	imageInfo3.title = "工商营业执照";
        	images[2] = imageInfo3;
        	
        	var imageInfo4 = {};
        	strTemp = "<s:property value='memberDto.imageLegalCertificatesFront'/>";
        	if(strTemp==''){
        		intTemp = null;
        	}else{
        		intTemp = parseInt(strTemp);
        	}
        	imageInfo4.image_id = intTemp;
        	imageInfo4.loaded = false;
        	imageInfo4.image_data = null;
        	imageInfo4.title = "法人证件正面";
        	images[3] = imageInfo4;

        	var imageInfo5 = {};
        	strTemp = "<s:property value='memberDto.imageLegalCertificatesBack'/>";
        	if(strTemp==''){
        		intTemp = null;
        	}else{
        		intTemp = Integer.valueOf(strTemp);
        	}
        	imageInfo5.image_id = intTemp;
        	imageInfo5.loaded = false;
        	imageInfo5.image_data = null;
        	imageInfo5.title = "法人证件背面";
        	images[4] = imageInfo5; 
        	
        	$.each(images, function(index, imageInfo) {       		
				$.loadImage(imageInfo.image_id, urlPrefix, {
					onSuccess: function(image) {
						images[index].image_data = image;
						images[index].loaded = true;
						imageLoadCount = imageLoadCount + 1;
						if (imageLoadCount == 5) {
							initImages();
						}
					},
					onNoImage: function() {						
						images[index].image_data = "${pageContext.request.contextPath}/img/no_image.png";
						images[index].loaded = true;
						imageLoadCount = imageLoadCount + 1;
						if (imageLoadCount == 5) {
							initImages();
						}
					},
					onError: function(error) {						
						images[index].image_data = "${pageContext.request.contextPath}/img/no_image.png";
						images[index].loaded = true;
						imageLoadCount = imageLoadCount + 1;
						if (imageLoadCount == 5) {
							initImages();
						}
					}
				});
			});
		}
	}
	
	function initImages() {		
		var imageItems = new Array();
		$.each(images, function(index, image) {
			var imageItem = {};
			imageItem.src = image.image_data;
			imageItem.title = image.title;
			imageItems.push(imageItem);			
		});	
		
		$('#btn_show_image_popup').magnificPopup({
			items: imageItems,				
			gallery: {
		        enabled: true
	        },
			type: 'image',
			callbacks: {
			    open: function() {
			    	$('div.mfp-bg').css('z-index','10000');
			    	$('div.mfp-wrap').css('z-index','10001');
			    },
			    close: function() {
			     
			    }
			    
			} 
		});
	}	
});
</script>
 <table class="edit_table member_table">
      <tr>
        <th >会员登录名</th>
        <td colspan="3" ><label id="memberLoginName" class="titlelabellong"><s:property value='memberDto.memberLoginName' /></label> </td>
      </tr>
      <tr>
        <th >企业名称</th>
        <td colspan="3"><label id="enterpriseName" class="titlelabellong"><s:property value='memberDto.enterpriseName' /></label></td>
      </tr>
      <tr>
        <th >企业性质</th>
        <td ><label id="enterprisePropertyName" class="titlelabel"><s:property value='memberDto.enterprisePropertyName' /></label></td>
        <th >企业分类</th>
        <td ><label id="enterpriseCategoryName" class="titlelabel"><s:property value='memberDto.enterpriseCategoryName' /></label></td>
      </tr>
      <tr>
        <th >联系人</th>
        <td ><label id="contactName" class="titlelabel"><s:property value='memberDto.contactName' /></label></td>
         <th>证件号码</th>
        <td ><label id="contactCertificatesNo" class="titlelabel"><s:property value='memberDto.contactCertificatesNo' /></label></td>
      </tr>
      <tr>
        <th >固定电话</th>
        <td ><label id="telephone" class="titlelabel"><s:property value='memberDto.tel' /></label></td>
        <th >手机号码</th>
        <td ><label id=mobile class="titlelabel"><s:property value='memberDto.mobile' /></label></td>
      </tr>
      <tr>       
        <th >电子邮箱</th>
        <td colspan="3"><label id="email" class="titlelabel"><s:property value='memberDto.email' /></label></td>
      </tr>
      <tr>
        <th>QQ号码</th>
        <td ><label id="qqNo" class="titlelabel"><s:property value='memberDto.qqNo' /></label></td>
        <th>微信号码</th>
        <td ><label id="weixinNo" class="titlelabel"><s:property value='memberDto.weixinNo' /></label></td>
      </tr>
      <tr>
        <th >法人姓名</th>
        <td ><label id="legalName" class="titlelabel"><s:property value='memberDto.legalName' /></label></td>
        <th >证件号码</th>
        <td ><label id="legalCertificatesNo" class="titlelabel"><s:property value='memberDto.legalCertificatesNo' /></label></td>
      </tr>
      <tr>
        <th >会员等级</th>
        <td ><label id="rankName" class="titlelabel"><s:property value='memberDto.rankName' /></label></td>
        <th >会员积分</th>
        <td ><label id="points" class="titlelabel"><s:property value='memberDto.points' /></label></td>
      </tr>
      <tr>
        <th>电子资质材料</th>
        <td colspan="3"><a id="btn_show_image_popup" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">点击查看图片</a></td>
      </tr>
     
</table>
